<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Linux," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;usermod 命令修改系统帐户文件来反映通过命令行指定的变化     选项&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;-a|–append&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#">
<meta name="keywords" content="Linux">
<meta property="og:type" content="article">
<meta property="og:title" content="Linux 修改用户属性">
<meta property="og:url" content="https://hcldirgit.github.io/2017/09/03/1. Linux 基础/11. Linux usermod 修改用户属性/index.html">
<meta property="og:site_name" content="失落的乐章">
<meta property="og:description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;usermod 命令修改系统帐户文件来反映通过命令行指定的变化     选项&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;-a|–append&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2017-09-01T08:11:46.487Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Linux 修改用户属性">
<meta name="twitter:description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;usermod 命令修改系统帐户文件来反映通过命令行指定的变化     选项&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;-a|–append&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://hcldirgit.github.io/2017/09/03/1. Linux 基础/11. Linux usermod 修改用户属性/"/>





  <title>Linux 修改用户属性 | 失落的乐章</title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', '85*****1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?87980c**************99ec5e26fb5";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>











  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">失落的乐章</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">技术面前，永远都是学生。</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-external-link"></i> <br />
            
            留言
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="https://hcldirgit.github.io/2017/09/03/1. Linux 基础/11. Linux usermod 修改用户属性/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="失落的乐章">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/0.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="失落的乐章">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Linux 修改用户属性</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-09-03T01:55:11+08:00">
                2017-09-03
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;us<br>ermod 命令修改系统帐户文件来反映通过命令行指定的变化    </p>
<h2 id="选项"><a href="#选项" class="headerlink" title="选项"></a>选项</h2><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-a|–append&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;##把用户追加到某些组中，仅与-G选项一起使用 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-c|–comment&#160;&#160;&#160;&#160;&#160;&#160;&#160;##修改/etc/passwd文件第五段comment</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-d|–home&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;##修改用户的家目录通常和-m选项一起使用 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-e|–expiredate&#160;&#160;&#160;&#160;&#160;&#160;##指定用户帐号禁用的日期，格式YY-MM-DD </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-f|–inactive&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ##用户密码过期多少天后采用就禁用该帐号，0表示密码已过期就禁用帐号，-1表示禁用此功能，默认值是-1 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-g|–gid&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ##修改用户的gid，改组一定存在</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-G|–groups&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;##把用户追加到某些组中，仅与-a选项一起使用 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-l|–login&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;##修改用户的登录名称</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-L|–lock&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;##锁定用户的密码 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-m|–move-home&#160;&#160;&#160;##修改用户的家目录通常和-d选项一起使用 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-s|–shell&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;##修改用户的shell </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-u|–uid&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;##修改用户的uid，该uid必须唯一 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-U|–unlock&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;##解锁用户的密码 </p>
<h2 id="示例"><a href="#示例" class="headerlink" title="示例"></a>示例</h2><h3 id="1-新建用户-test-，密码-test-，另外添加-usertest-组"><a href="#1-新建用户-test-，密码-test-，另外添加-usertest-组" class="headerlink" title="1.新建用户 test ，密码 test ，另外添加 usertest 组"></a>1.新建用户 test ，密码 test ，另外添加 usertest 组</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#useradd test </span></div><div class="line"><span class="comment">#echo "test" | passwd --stdin test </span></div><div class="line"><span class="comment">#groupadd usertest</span></div></pre></td></tr></table></figure>
<h3 id="2-把-test-用户加入-usertest-组"><a href="#2-把-test-用户加入-usertest-组" class="headerlink" title="2.把 test 用户加入 usertest 组"></a>2.把 test 用户加入 usertest 组</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#usermod -aG usertest test ##多个组之间用空格隔开 </span></div><div class="line"><span class="comment">#id test </span></div><div class="line">uid=500(<span class="built_in">test</span>) gid=500(<span class="built_in">test</span>) groups=500(<span class="built_in">test</span>),501(usertest)</div></pre></td></tr></table></figure>
<h3 id="3-修改-test-用户的家目录"><a href="#3-修改-test-用户的家目录" class="headerlink" title="3.修改 test 用户的家目录"></a>3.修改 test 用户的家目录</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#usermod -md /home/usertest </span></div><div class="line"><span class="comment">#ls /home </span></div><div class="line">usertest</div></pre></td></tr></table></figure>
<h3 id="4-修改用户名"><a href="#4-修改用户名" class="headerlink" title="4.修改用户名"></a>4.修改用户名</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#usermod -l urchin(新用户名称)  test(原来用户名称) </span></div><div class="line"><span class="comment">#id urchin </span></div><div class="line">uid=500(urchin) gid=500(<span class="built_in">test</span>) groups=500(<span class="built_in">test</span>),501(usertest)</div></pre></td></tr></table></figure>
<h3 id="5-锁定-urchin-的密码"><a href="#5-锁定-urchin-的密码" class="headerlink" title="5.锁定 urchin 的密码"></a>5.锁定 urchin 的密码</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="comment"># sed -n '$p' /etc/shadow </span></div><div class="line">urchin:<span class="variable">$6</span><span class="variable">$1PwPVBn5</span><span class="variable">$o</span>.MIEYONzURQPvn/YqSp69kt2CIASvXhOnjv/t \</div><div class="line">Z5m4NN6bJyLjCG7S6vmji/PFDfbyITdm1WmtV45CfHV5vux/:15594:0:99999:7::: </div><div class="line"><span class="comment">#usermod -L urchin </span></div><div class="line"><span class="comment"># sed -n '$p' /etc/shadow </span></div><div class="line">urchin:!<span class="variable">$6</span><span class="variable">$1PwPVBn5</span><span class="variable">$o</span>.MIEYONzURQPvn/YqSp69kt2CIASvXhOnjv/t \</div><div class="line">Z5m4NN6bJyLjCG7S6vmji/PFDfbyITdm1WmtV45CfHV5vux/:15594:0:99999:7:::</div></pre></td></tr></table></figure>
<h3 id="6-解锁-urchin-的密码"><a href="#6-解锁-urchin-的密码" class="headerlink" title="6.解锁 urchin 的密码"></a>6.解锁 urchin 的密码</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#usermod -U urchin </span></div><div class="line"><span class="comment"># sed -n '$p' /etc/shadow </span></div><div class="line">urchin:<span class="variable">$6</span><span class="variable">$1PwPVBn5</span><span class="variable">$o</span>.MIEYONzURQPvn/YqSp69kt2CIASvXhOnjv/t \ </div><div class="line">Z5m4NN6bJyLjCG7S6vmji/PFDfbyITdm1WmtV45CfHV5vux/:15594:0:99999:7:::</div></pre></td></tr></table></figure>
<h3 id="7-修改用户的-shell"><a href="#7-修改用户的-shell" class="headerlink" title="7.修改用户的 shell"></a>7.修改用户的 shell</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#sed '$!d' /etc/passwd </span></div><div class="line">urchin:x:500:500::/home/usertest:/bin/bash </div><div class="line"><span class="comment">#usermod -s /bin/sh urchin </span></div><div class="line"><span class="comment">#sed -n '$p' /etc/passwd </span></div><div class="line">urchin:x:500:500::/home/usertest:/bin/sh</div></pre></td></tr></table></figure>
<h3 id="8-修改用户的-UID"><a href="#8-修改用户的-UID" class="headerlink" title="8.修改用户的 UID"></a>8.修改用户的 UID</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#usermod -u 578 urchin (UID必须唯一) </span></div><div class="line"><span class="comment">#id urchin </span></div><div class="line">uid=578(urchin) gid=500(<span class="built_in">test</span>) groups=500(<span class="built_in">test</span>),501(usertest)</div></pre></td></tr></table></figure>
<h3 id="9-修改用户的-GID"><a href="#9-修改用户的-GID" class="headerlink" title="9.修改用户的 GID"></a>9.修改用户的 GID</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#groupadd -g 578 test1 </span></div><div class="line"><span class="comment">#usermod -g 578 urchin (578组一定要存在) </span></div><div class="line"><span class="comment">#id urchin </span></div><div class="line">uid=578(urchin) gid=578(test1) groups=578(test1),501(usertest)</div></pre></td></tr></table></figure>
<h3 id="10-指定帐号过期日期"><a href="#10-指定帐号过期日期" class="headerlink" title="10.指定帐号过期日期"></a>10.指定帐号过期日期</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="comment"># sed -n '$p' /etc/shadow </span></div><div class="line">urchin:<span class="variable">$6</span><span class="variable">$1PwPVBn5</span><span class="variable">$o</span>.MIEYONzURQPvn/YqSp69kt2CIASvXhOnjv/t \ </div><div class="line">Z5m4NN6bJyLjCG7S6vmji/PFDfbyITdm1WmtV45CfHV5vux/:15594:0:99999:7::: </div><div class="line"><span class="comment"># usermod -e 2012-09-11 urchin </span></div><div class="line"><span class="comment"># sed -n '$p' /etc/shadow </span></div><div class="line">urchin:<span class="variable">$6</span><span class="variable">$1PwPVBn5</span><span class="variable">$o</span>.MIEYONzURQPvn/YqSp69kt2CIASvXhOnjv/t \ </div><div class="line">Z5m4NN6bJyLjCG7S6vmji/PFDfbyITdm1WmtV45CfHV5vux/:15594:0:99999:7::15594:</div></pre></td></tr></table></figure>
<h3 id="11-指定用户帐号密码过期多少天后，禁用该帐号"><a href="#11-指定用户帐号密码过期多少天后，禁用该帐号" class="headerlink" title="11.指定用户帐号密码过期多少天后，禁用该帐号"></a>11.指定用户帐号密码过期多少天后，禁用该帐号</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="comment"># usermod -f 0 urchin </span></div><div class="line"><span class="comment"># sed -n '$p' /etc/shadow </span></div><div class="line">urchin:<span class="variable">$6</span><span class="variable">$1PwPVBn5</span><span class="variable">$o</span>.MIEYONzURQPvn/YqSp69kt2CIASvXhOnjv/t \ </div><div class="line">Z5m4NN6bJyLjCG7S6vmji/PFDfbyITdm1WmtV45CfHV5vux/:15594:0:99999:7:0:15594:</div></pre></td></tr></table></figure>
<h2 id="注意"><a href="#注意" class="headerlink" title="注意"></a>注意</h2><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;usermod 不允许改变正在线上的使用者帐号名称。当 usermod 用来改变 userID ,必须确认这名 user 没在电脑上执行任何程序</p>
<p>/etc/passwd<br>user_name:x:uid:gid:commnet:home:shell        </p>
<p>/etc/shadow<br>username:passwd:lastchg:min:max:warn:inactive:expire:flag<br>–用户名<br>–密码<br>–从1970年1月1日起到上次修改密码所经过的天数<br>–密码再过几天可以被变更(0表示随时可以改变)<br>–密码再过几天必须被变更(99999表示永不过期)<br>–密码过期前几天提醒用户(默认为一周)<br>–密码过期几天后帐号被禁用<br>–从1970年1月1日算起，多少天后账号失效      </p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Linux/" rel="tag"># Linux</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/09/03/1. Linux 基础/72. 进程与线程/" rel="next" title="进程与线程">
                <i class="fa fa-chevron-left"></i> 进程与线程
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/09/03/1. Linux 基础/5. Linux 文件权限/" rel="prev" title="Linux 文件权限">
                Linux 文件权限 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/0.png"
               alt="失落的乐章" />
          <p class="site-author-name" itemprop="name">失落的乐章</p>
           
              <p class="site-description motion-element" itemprop="description">失落的乐章的Blog</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/">
                <span class="site-state-item-count">627</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">38</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/hcldirgit" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#选项"><span class="nav-number">1.</span> <span class="nav-text">选项</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#示例"><span class="nav-number">2.</span> <span class="nav-text">示例</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-新建用户-test-，密码-test-，另外添加-usertest-组"><span class="nav-number">2.1.</span> <span class="nav-text">1.新建用户 test ，密码 test ，另外添加 usertest 组</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-把-test-用户加入-usertest-组"><span class="nav-number">2.2.</span> <span class="nav-text">2.把 test 用户加入 usertest 组</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-修改-test-用户的家目录"><span class="nav-number">2.3.</span> <span class="nav-text">3.修改 test 用户的家目录</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-修改用户名"><span class="nav-number">2.4.</span> <span class="nav-text">4.修改用户名</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-锁定-urchin-的密码"><span class="nav-number">2.5.</span> <span class="nav-text">5.锁定 urchin 的密码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#6-解锁-urchin-的密码"><span class="nav-number">2.6.</span> <span class="nav-text">6.解锁 urchin 的密码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#7-修改用户的-shell"><span class="nav-number">2.7.</span> <span class="nav-text">7.修改用户的 shell</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#8-修改用户的-UID"><span class="nav-number">2.8.</span> <span class="nav-text">8.修改用户的 UID</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#9-修改用户的-GID"><span class="nav-number">2.9.</span> <span class="nav-text">9.修改用户的 GID</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#10-指定帐号过期日期"><span class="nav-number">2.10.</span> <span class="nav-text">10.指定帐号过期日期</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#11-指定用户帐号密码过期多少天后，禁用该帐号"><span class="nav-number">2.11.</span> <span class="nav-text">11.指定用户帐号密码过期多少天后，禁用该帐号</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#注意"><span class="nav-number">3.</span> <span class="nav-text">注意</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">失落的乐章</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  





  

  

  

  

  

  

</body>
</html>
